.class public abstract Lcom/xiaomi/common/BasicRefreshScheduler;
.super Ljava/lang/Object;
.source "BasicRefreshScheduler.java"


# static fields
.field public static final AUTO:I = 0x0

.field public static final CHECK_NEW_VERSION:I = 0x8

.field public static final FORCE:I = 0x10

.field public static final SCHEDULE_ALWAYS:I


# instance fields
.field protected mContext:Landroid/content/Context;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 0
    .parameter "context"

    .prologue
    .line 15
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 16
    iput-object p1, p0, Lcom/xiaomi/common/BasicRefreshScheduler;->mContext:Landroid/content/Context;

    .line 17
    return-void
.end method


# virtual methods
.method protected getDefaultRefreshMode()I
    .locals 1

    .prologue
    .line 35
    const/16 v0, 0x8

    return v0
.end method

.method protected getDefaultRefreshSchedule()I
    .locals 1

    .prologue
    .line 42
    const/4 v0, 0x0

    return v0
.end method

.method protected abstract getDefaultRefreshTask(I)Lcom/xiaomi/common/BasicRefreshTask;
.end method

.method public refresh(II)V
    .locals 1
    .parameter "mode"
    .parameter "schedule"

    .prologue
    .line 23
    if-eqz p2, :cond_0

    .line 24
    new-instance v0, Ljava/lang/UnsupportedOperationException;

    invoke-direct {v0}, Ljava/lang/UnsupportedOperationException;-><init>()V

    throw v0

    .line 26
    :cond_0
    if-nez p1, :cond_1

    .line 27
    invoke-virtual {p0}, Lcom/xiaomi/common/BasicRefreshScheduler;->getDefaultRefreshMode()I

    move-result p1

    .line 28
    :cond_1
    invoke-virtual {p0, p1}, Lcom/xiaomi/common/BasicRefreshScheduler;->refreshInternal(I)V

    .line 29
    return-void
.end method

.method protected refreshInternal(I)V
    .locals 2
    .parameter "mode"

    .prologue
    .line 51
    invoke-virtual {p0, p1}, Lcom/xiaomi/common/BasicRefreshScheduler;->getDefaultRefreshTask(I)Lcom/xiaomi/common/BasicRefreshTask;

    move-result-object v0

    const/4 v1, 0x0

    new-array v1, v1, [Ljava/lang/Void;

    invoke-virtual {v0, v1}, Lcom/xiaomi/common/BasicRefreshTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    .line 52
    return-void
.end method
